<?php
/**
 * Variable
 *
 * Variables in GOP are represented by a dollar sign followed by the name
 * of the variable. The variable name is case-sensitive.
 *
 * Variable names follow the same rules as other labels. A valid variable
 * name starts with a letter or underscore, followed by any number of
 * letters, numbers, or underscores. As a regular expression, it would
 * be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
 *
 * @author  Badrus Said <badrus.said@gmail.com>
 * @since   gop1.0
 */
final class gop_Variable extends gop_Base {
    public function increment() {$this->setResult($this->getResult() + 1);}
    public function decrement() {$this->setResult($this->getResult() - 1);}
    public function execute(gop_Base $_caller = null) {
        if (!is_null($_caller)) {
            $_caller->setCaller($this);
            $_caller->setResult($this->getResult());
        }
    }
}
?>